<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title><?php echo $ptitle ?></title>
    <meta name="description" content="<?php echo $desc ?>"/>
    <meta name="keywords" content="<?php echo $keyword ?>" />
    <meta name="author" content="<?php echo $author ?>">

    <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/theme/images/favicon.ico"/>    
    <link rel="stylesheet" href="<?php echo base_url(); ?>assets/theme/css/bootstrap.css"/>
    <link rel="stylesheet" href="<?php echo base_url(); ?>assets/theme/css/font-awesome.css"/>
    <link rel="stylesheet" href="<?php echo base_url(); ?>assets/theme/css/colorbox.css"/>
    <link rel="stylesheet" href="<?php echo base_url(); ?>assets/theme/css/uniform.css"/>
    <link rel="stylesheet" href="<?php echo base_url(); ?>assets/theme/css/customfront.css"/>

    <?php echo '<script>const site_url = "' . base_url() . '"</script>' ?>
    <script src="<?php echo base_url(); ?>assets/theme/js/jquery/jquery-1.8.3.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/theme/js/bootstrap.js"></script>
    <script src="<?php echo base_url(); ?>assets/theme/js/jquery.colorbox.js"></script>
    <script src="<?php echo base_url(); ?>assets/theme/js/uniform.js"></script>
    <script src="<?php echo base_url(); ?>assets/theme/js/custom.js"></script>
</head>

<body>

<div class="head-area">
    <div class="container">
        <div class="row"><!-- start header -->
            <div class="span4 logo">
                <a href="<?php echo site_url(); ?>">
                    <img src="<?php echo base_url() ?>assets/theme/images/logo.png">
                </a>
            </div>		
            <div class="span4 customer_service pull-right text-right">
                <br>
                <ul class="sosyal clearfix">
                    <?php if ($psosyal['pinterest']) { ?><li><a href="<?php echo $psosyal['pinterest'] ?>" class="pinterest sosyal"><i class="icon-pinterest"></i></a></li><?php } ?>
                    <?php if ($psosyal['linkedin']) { ?><li><a href="<?php echo $psosyal['linkedin'] ?>" class="linkedin sosyal"><i class="icon-linkedin"></i></a></li><?php } ?>
                    <?php if ($psosyal['google']) { ?><li><a href="<?php echo $psosyal['google'] ?>" class="google sosyal"><i class="icon-google-plus"></i></a></li><?php } ?>
                    <?php if ($psosyal['twitter']) { ?><li><a href="http://twitter.com/<?php echo $psosyal['twitter'] ?>" class="twitter sosyal"><i class="icon-twitter"></i></a></li><?php } ?>
                    <?php if ($psosyal['facebook']) { ?><li><a href="<?php echo $psosyal['facebook'] ?>" class="facebook sosyal"><i class="icon-facebook"></i></a></li><?php } ?>
                </ul>               

                <h4><small><?php echo $desc ?></small></h4>
            </div>
        </div><!-- end header -->
        <div class="row"><!-- start nav -->
            <div class="span12">
                <div class="navbar navbar-inverse">
                    <div class="navbar-inner">
                        <div class="container">
                            <div class="nav-collapse">
                                <ul class="nav">
                                    <li class="first"><a href="<?php echo site_url(); ?>"><?php echo lang('home_homebtn') ?></a></li>
                                    <li class="dropdown">
                                        <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo lang('home_categorybtn') ?> <b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <?php
                                            if (!empty($pcategory)) {
                                                foreach ($pcategory as $key => $item) {
                                                    echo "<li><a href='" . site_url() . "cat/$key'>$item</a></li>";
                                                }
                                            }
                                            ?>
                                        </ul>
                                    </li>							
                                    <li class="dropdown">
                                        <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo lang('home_typebtn') ?> <b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <?php
                                            if (!empty($ptype)) {
                                                foreach ($ptype as $key => $item) {
                                                    echo "<li><a href='" . site_url() . "type/$key'>$item</a></li>";
                                                }
                                            }
                                            ?>
                                        </ul>
                                    </li>
                                    <?php
                                    if (!empty($pdata)) {
                                        foreach ($pdata as $key => $item) {
                                            echo "<li><a class='first' href='" . site_url() . "pages/$key'>$item</a></li>";
                                        }
                                    }
                                    ?>

                                </ul>

                                <ul class="nav pull-right">
                                    <li class="first"><a href="<?php echo site_url() . "blog" ?>"><?php echo lang('home_blogbtn') ?></a></li>
                                    <?php if (!$this->session->userdata('user_id')) { ?>
                                        <li class="first"><a href="<?php echo site_url() . "register" ?>"><?php echo lang('home_signupbtn') ?></a></li>			
                                        <li class="dropdown">
                                            <a data-toggle="dropdown" href="#" class="dropdown-toggle"><?php echo lang('home_signinbtn') ?> <strong class="caret"></strong></a>
                                        <div class="dropdown-menu">
                                            <?php
                                            echo form_open("auth/login");
                                            $identity = array('name' => 'identity', 'id' => 'identity', 'type' => 'text', 'placeholder' => lang('home_username'), 'size' => '30');
                                            $password = array('name' => 'password', 'id' => 'password', 'type' => 'password', 'placeholder' => lang('home_password'), 'size' => '30');
                                            echo form_input($identity);
                                            echo form_input($password);
                                            ?>
                                            <label class="forgotP"><a href="<?php echo site_url() . "forgot_password" ?>"><?php echo lang('home_forgotpassword') ?></a></label>
                                            <label class="string optional"><?php echo form_checkbox('remember', '1', FALSE, 'id="remember"'); ?><?php echo lang('home_rememberme') ?></label> 
                                            <?php echo form_submit('submit', lang('home_loginbtn'), 'class="btn btn-block btn-info"'); ?>
                                            <?php echo form_close(); ?>                       
                                        </div>
                                    <?php } else { ?>
                                        <li class="dropdown">
                                            <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo lang('home_userpanels') ?><b class="caret"></b></a>
                                            <ul class="dropdown-menu">
                                                <li class="current-user">
                                                    <a data-nav="edit_profile" class="account-summary account-summary-small" href="<?php echo site_url() . "profile" ?>">
                                                        <img src="<?php echo "http://www.gravatar.com/avatar/" . md5(strtolower(trim($this->session->userdata('email')))) . "&s=32" ?>" class="avatar size32">
                                                        <div class="userinfo"><b class="fullname"><?php echo $pusername[0]['first_name'] . ' ' . $pusername[0]['last_name'] ?></b>
                                                            <small class="metadata"><?php echo lang('home_profiledit') ?></small>
                                                        </div>
                                                    </a>
                                                </li>
                                                <li class="divider"></li>
                                                <?php if ($this->session->userdata('level') >= 2) { ?>
                                                    <?php if ($this->session->userdata('level') >= 3) { ?>
                                                        <li><a href="<?php echo site_url() . 'admin/estateAdd' ?>"><?php echo lang('home_addestate') ?></a></li>
                                                    <?php } ?>
                                                    <li><a href="<?php echo site_url() . 'admin/blogAdd' ?>"><?php echo lang('home_addblog') ?></a></li>
                                                    <?php if ($this->session->userdata('level') >= 4) { ?>
                                                        <li><a href="<?php echo site_url() . 'admin/pageAdd' ?>"><?php echo lang('home_addpage') ?></a></li>
                                                    <?php } ?>
                                                    <li class="divider"></li>
                                                    <li><a href="<?php echo site_url() . 'admin' ?>"><b><?php echo lang('home_admindashboard') ?></b></a></li>
                                                <?php } ?>
                                                <li><a href="<?php echo site_url() . 'change_password' ?>"><?php echo lang('home_changepassword') ?></a></li>
                                                <li class="divider"></li>
                                                <li><a href="<?php echo site_url() . 'logout' ?>"><?php echo lang('home_logout') ?></a></li>
                                            </ul>
                                        </li>
                                    <?php } ?>
                                    </li>
                                </ul>
                            </div><!-- /.nav-collapse -->
                        </div>
                    </div><!-- /navbar-inner -->
                </div><!-- /navbar -->
            </div>
        </div><!-- end nav -->
    </div>
</div>